<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
//登录路由
Route::post('login','Api\LoginController@login');

//请求验证token
//中间件
//版本号v1
//可用rsa非对称加密
Route::group(['middleware'=>'auth:api','prefix'=>'v1','namespace'=>'Api'],function(){
    Route::get('users',function(){
       return '123456';
    });

    //小程序登录
    Route::post('wxlogin','LoginController@wxlogin');
    //文件上传
    Route::post('user/upfile','UserController@upfile');
    //获取用户信息
    Route::get('user/userinfo','UserController@getuserinfo');
    //用户授权信息入库
    Route::post('user/userinfo','UserController@userinfo');
    //看房通知
    Route::get('notices','NoticeController@index');
    //资讯列表
    Route::get('news','NewsController@index');
    //资讯详情
    Route::get('news/{article}','NewsController@show');
    //资源用户访问统计
    Route::post('news/{article}','NewsController@count');

    //房源
    //房源列表
    Route::get('fangs','FangController@fang');
    //推荐房源
    Route::get('fangs/recommend','FangController@recommend');
    //房源属性
    Route::get('fangs/attr','FangController@attr');
    //房源详情
    Route::get('fangs/{fang}','FangController@detail');




});
